<?php
$this->_toolbar = array(
		'title'		=>	Yii::t('admin_comments', 'Comment Manager'),
		'buttons'	=>	array(
			CHtml::link(Yii::t('app','Delete'), "", array("id"=>"delete", "class"=>"button-s del", "onclick"=>"CoreJs.deleteAll('".Yii::app()->createUrl('/admin_comments/comment/delMulti')."','".Yii::t('app','Are you sure you want to delete item?')."')")),
			CHtml::link(Yii::t('app','Advanced Search'), "",array("id"=>"search", "class"=>"search-button button-s")),
		)
);

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$.fn.yiiGridView.update('comment-grid', {
		data: $(this).serialize()
	});
	return false;
});
");
?>

<div class="search-form">
<?php $this->renderPartial('_search', array(
	'model' => $model,
)); ?>
</div><!-- search-form -->
<?php 
	Yii::app()->clientScript->registerScript('tooltip2', "jQuery('.button-column a').tooltip();");
?>
<?php $this->widget('ext.widgets.iGridView', array(
	'id' => 'comment-grid',
	'dataProvider' => $model->search(),
	'afterAjaxUpdate'=>'function(){jQuery(".button-column a").tooltip();}',
	'columns' => array(
		array(
			'type'	=>	'raw',
			'header'	=>'<div id="sl-row" onclick="CoreJs.checkAll(this.id);" status="1"><input type="checkbox" class="checkall" value="" /></div>',
			'htmlOptions'	=>	array(
				'width'	=>	'50',
			),
			'value'	=>	'CHtml::checkBox("rad_ID[]", "", array("value"=>$data->id))'
		),
		array(
			'name'	=>	'email',
			'type'	=>	'raw',
			'value'	=>	'CHtml::link(CHtml::encode($data->email), array(\'/admin_comments/comment/update\', \'id\'=>$data->id))'
		),
		array(
			'name'	=>	'post_id',
			'value'	=>	'$data->news'
		),
		array(
			'name'=>'status',
			'value'	=>	'Lookup::item(\'CommentStatus\', $data->status)',
		),
		array(
			'name'=>'type',
			'htmlOptions'=>array(
				'align'=>'center',
				'width'	=> '100'
			)
		),
		/*
		'type',
		'create_time',
		'author',
		'modified',
		'modified_by',
		*/
		array(
			'class' => 'CButtonColumn',
		),
		array(
			'name'=>'id',
			'htmlOptions'=>array(
				'width'	=> '30'
			)
		),
	),
)); ?>
